$(function () {
    function getCookieValue(name) {
        let result = document.cookie.match("(^|[^;]+)\\s*" + name + "\\s*=\\s*([^;]+)")
        return result ? result.pop() : ""
    }

    var token = getCookieValue("token");
    console.log(document.cookie);
    if(!token){
        console.log("没有发现cookie");
        return;
    }
    var urlstr = "/api/user/info/" + token;
    $.ajax({
        type: "post",
        url: urlstr,
        data: {
            token: token
        },
        success: function (data) {
            if (data) {
                document.getElementById("user-email").innerText = data;
                document.getElementById("login").remove;

            }
        }
    });
})